package core.listeners;

import gui.components.CalcTextField;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

public class TextChangeListener implements ActionListener{
	
	CalcTextField textField = null;
	
	public TextChangeListener(CalcTextField textField) {
		this.textField = textField;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if (e.getSource() instanceof JButton)
		{
			JButton button = (JButton) e.getSource();
			char symbol = button.getText().charAt(0);
			textField.readSymbol(symbol);
		}
		
	}

}
